Refactoring mini-ghost

This pull request proposes changes to the mini-ghost example. It refactors the code for better readability, and straightens certain constructs.