implement dispose pattern for screens and layers