make Makefile more portable
conciseness refactoring in typedefs
use hash to store tables