completed refactor
separated to diff files