cleaned up base functionality

Signed-off-by: Harry Truong <harry.truong@redcross.org>
[stable] more refactoring

Signed-off-by: Harry Truong <harry.truong@redcross.org>