Partial refactored core;

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