Moved service related things into service