more refactor missed one function