Created a more effiecient version of getAction()