added some helper functions for creating encoders