Reduce calls to state.render in migrations

`state.render` is actually very long, so this commit easily reduce the
number of times it needs to be called by moving some calls only after
`allowed_to_migrate` was called (to avoid calling render states we won't
need)
Avoid calling allow_migrate if unneeded

It will simply avoid a function call and potential
logic in `allow_migrate` if there is no need to