Minor refactors and javadocs were added