Big refactor :D
Should probably commit more.
Fixed cyclical things.