use directory handlers rather than files
remove unused code