Optimize _ls method to use builtins