Refactored packages, improved javadocs