Move compatibility stuff to its own file