Refactoring: removed switch