refactor, make tests pass, use inject_body, callback function