did some code cleanup

if you like it, please merge!