more complex example
some code refactoring