Refactored the example a bit