Added config file and simplified controller