refactor into separate classes, implement reload command, simplify configuration