added docs folder. changed factory method