Refactoring to make the code comply to checkstyle rules