added callbacks and refactored module organization