moved stuff around to be more mvc like