refactoring of certain actions