Remove codeduplication by usage of before_filter

Remove Codeduplication, by usage of before_filter's