Coding style improvements, removed some dead code, subdirectory specification