Small refactoring as suggested by @kea