Added some code cleanup