small refactory to improve code