Refactored - reduced cyclomatic complexity of the addDefinedFields method.
Remove @todo.
Added basic validation.