refactor and lint