refactoring abstract, possible cause of mem leaks