reorganize repo to be more modular and testable