refactor by Leandro