restructure modules and dependencies