move services into a dedicated js file