refactoring: renamed method, extracted method; added javadoc