Wrote service functions