Cleanup some code and make it cleaner?