several improvements and adding slf4j support