refactored more code into actions