moved daemon to seperate file