Improved cli locations detect