Fixed the problem with the code duplication on showRootDirectory. Other style issues also solved