moved to mainController