cleaned up package, used reflect for easier adding of custom rules