Moved code to service sub module