cleand up code for readability