moving code that all apps share to dfm