Removed unnecessary parts, using nullable types instead of a weird option type.