fixed error with casting boolean -> primitives
new singleton
added caching generics -- changed for better semantics
added cache type
test extended