Added configuration file, configurable layout and cleaned the code