duplicate code between actions