Refactor Code And Update Header Files