Refactored random key generation code and data model.
Application restructuring and data model update.