refactored into ls and using middleware project via npm