restructuring classes device/frontend