changed type back do dir
refactor and linting