- refactored single function