Added more comments and some more methods to factory