Added documentation and improved error message on duplicate factories