add number validation & refactor app controller