Move utility functions to service classes, add DB index