Refactor source for new IDE layout