added deck factory and tests