refactored code to be more readable and partially support C13