Minor refactor, moving the members
Added some tests for verify the behavior