Refactor hardware dependent code
Merge branch 'move_callback'