Refacor get-function related