Fully functional refactoring including imageStates