Moving to separate function & javadocing