better documentation and modularity