move get age into function