Huge refactor... N-D