Partial Re-factoring;

Signed-off-by: ashwinh <ashwinh@cybage.com>