refactor apply helper function
clear up code and comment
perfect  apply for other user
clearup code and comment