Refactored into get_posts
Lots of changes