restructured everything a bit