Slight clean up of code