added factory pattern using enum