Tidied up for refactoring
Fixed empty fields throwing error