Code refactoring.

Signed-off-by: Carl Thronson <cthronson@actuate.com>