refactor controller variables
add popularity column to posts