optimizations and ball window fade functionality