Refactor, Cleanup and renaming