splitted the code to improve maintainability