Clean code and add documentation.