structured everything as a library, for reusability