Some code tidying.
TODO (printf)