refactored state mutation, reflections and organized tests