Move common code into private method, use before_filter