make private functions better

functions defined with 'def' inside classes work much better now.

TODO: update docs to reflect changes made.