ks2 support and general cleanups