Moved compatibility code to it's own file