opacity refactor