Use pointers to global factory methods instead of factory objects

Signed-off-by: MHesham <mhesham.fcis@gmail.com>