Update code (configurations and refactoring the main class)