refactor and adding classes