moved data handler to its own file