Added ReceiptCommand and tidied up code