Add support for fields with a space in the name.
Adding better encapsulation and code cleanup