Cleanup and refactoring! saweet