refactor list command, fixes issue #14