added factory class and interface