Added factory pattern, need to remove parser, not used anymore