reduced complexity and number of statements in main function