before_filter refactored