Further code beautification and javadoc additions