Applied method refactoring patch from alexrhein