some clean up to the code