Moved some paramest functionality to increase potential for performance
optimizations.
Bugfix and performance improvements