nicer code
Merge branch 'tech/optimizing-a-function'