devices refactor (wip)