Removed some commented code, refactored a little bit