Refactor IDE listeners and related APIs