Simplify api
Refactor device handling
Unify function names