Refactoring and using proxies