Revert "Porting to IDEA, part 2"

This reverts commit 1076d99507c2f1102086dd5417ba9a0677fb1dab.