refactor: removed switch statements