updated readme and added factory method