big refactor
done with refactor. turned out well