Rearrange imports and make them more strict