Small cleanups and additional comments
Add function to parse command params