major refactoring in core module. added file handler logic