adds some state ... the rest of these deleted lines are just refactored as stated above