Adding factory function

Moving usefull files to headers