remove left over end statement
replace ternary operation with functions
Merge branch 'pam' into pam-2.0