refactored code
added log4j2 to build.gradle and some test