Improve command layer and documentation