Moved the general transition code to its own module and added a class for parsing information to it.