First working example with refactors