added config refactor
refactored into semi MVC architecture