refactor all functions into classes + methods