Removed backwards compatibility hacks and much reformatting