Refactor

When reviewing this, please provide feedback on the documentation as well as on the functionality.