restructerring to separate services from controllers