cleaned up option transform code for readability