Added methods, used case..when syntax