http://work.netxforge.com/issues/425
- removal of duplicate code. 
- separate actions from commands.
http://work.netxforge.com/issues/403
Make chartID unique with a sequence number.