function refactoring
Revert "function refactoring"

This reverts commit 251569c07b9cdcedf4bba73f5701cc634c8b2f9d.