added factory method pattern