if文をきれいに書く方法 ref: http://qiita.com/items/b91a7e2249ecb3525433