refactor code to use before_filter for session checking; refactor code to for beer as it relates to posts