re-organized modules ; easier to test