Major refactor, email changes