Refactor function
Refactor function 1.2.4