refactor the code, extract POSTS namespace out, logic for testing which posts overlap with the crystal