Full refactoring of project. Known issue: does not run for now due to problems in configuration file.