reorganize resource base code into modules