Automatic update of units list. Better sorting. Code cleanups.