Improve method key logic