add slf4j for logging, small refactorings