update and refactor classes