code cleanup

thanks to /u/edkolev for the tips!