Started generalization of locations code