performance improvements and cleanup.

Changed requireArgs to inline, added new functionality