refactor some code in shadow overlay in exp2