Moved all of the code to background service

Signed-off-by: Umair Khan <omerjerk@gmail.com>