type safety, logging

avoid boxing/unboxing