Moved services into separate js file