Documentation and cleanup

- Add Javadoc to new methods and classes
- Get rid of magic number