Some refactoring in preparation for the default values of parameters.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>