Some refactoring, improved help