renamed and moved things around to make it easier to use when imported