patrick's code obfuscating refactor