cleaned up consumer code