Splitted main program into modules.