Restructure to get working in Idea.