Refactor: strategy pattern to replace case block