Cleaned some things up...

Modular version, removed redundant boxing and unboxing.