refactor into module