Yeah I think I'll refactor this to a proper class.