Working again after first stage of refactor