Refactored after a code-review