refactorings with annotated types