simple example refactored and working