Common function refactor
Common function refactor