This is quite easy and very widespread to accomplish by having helper functions for common operations.