Refactoring of the line callbacks. (Using a callback model instead of exceptions.)