Since about a year I am trying to follow the principles of Clean Code which are expressed in so-called four rules of simple design discussed at http://c2.com/cgi/wiki?XpSimplicityRules . And even longer I am convinced that code duplication is an evil. In this sense "extract method" means that the place the original method where the extracted code comes from should be changed to call the extracted method and so avoiding the duplication. In this particular case it means that you probably create a new object new File(uri.getPath).getName() later because you can return just one argument and it is probably not a file but the uri.