break this module out into pieces and make it a little nicer.