Added more config options + refactoring