revamp type deferrals and fix windows compilation