Code refactor part II [validation][finished]