Clean-up (moved more application specific code).