Improve reusability

Implement changes from given feedback to improve code reusability.

- [ ] Reorganize code structure
- [ ] Make output format rendering extensible