cleaned code for integrated window mode development