Added some basic support classes.
Refactoring.