Restructure checking condition