dfee6a4 refactor code