Made crude stuff generalized and added users and keys.