Add help message, also do small refactoring