function intro refactoring