Added data checking into factories