Cleaned up code and finish support for 6.0