Storing some state now, needs refactoring