renamed and cleaned up a bit