remove unused pragmas
simplify factory class to not rely on singleton + cleanups