Reorganize fields, add javadoc