magic method refactored