Adding docs and refactoring classes.