refactored postsList into controller