some clean up and adding utility to handle enum conversions