refactor example 3