Simplify overlay code