Improve Flash handling