further refactor into components