expose x window cache & code cleanups