Some cleanup of code

title