remove uneccessary factory pattern and associated code