locations is now collection not array, code refactored