Refactoring to make actions types instead of functions. <Ben>