Documenting the methods and cleaning up the code.