refactor, and fixed bugs.
add data handler