replace factories by interfaces