Small refactoring + improvement