refactor: remove big if clause