created factory for charging