Migrating code into daemon package.