There was probably a better way