Some refactoring, added interrupt transfer function