Refactoring. See: websharks/s2member#179 and websharks/s2member#270