hash these instead of if/else construct plus minor language changes