small refactor code