Cleaning up, refactoring, documenting