Decouple refactoring membership area

Fixed a problem caused when initialize, also refactored a few areas for
better understanding of the code.

Next step cover membership with unit tests!