Refactoring of HPDevice