Divided main method into modules.