split utility functions into modules
use _.memoize instead of keeping fake private properties
fix some minor bugs