refactor into a class!