refactoring, tests, presence config file