Moved the main actions to other file, cleaning the main file