Refactoring - inlined function