Made the windowElement class abstract and created windowElementImpl. Also added the close function.