Added logging, renamed some classes.