Move isTransparent logic to utils