More refactoring, log4j support added