moved callback to it's onw package and refactor