More work on commands
Improved database schema