Just needs a few validations and cleanup

This is a beast! I bet you'd write this very differently after this week :)