Refactoring jquery for finding stories