carlocations db functions refactoring