Added some code clean up