Removed some codesmells