refactored dup codes to functions
added 'remove' command
added help message for the 'remove' command