Refactored duplication in user action