Refactor to use atlas