Refactor user actions and tests