clean up code slightly