Some example of how to structure your code to avoid spaghetti code.