Few changes to avoid ordering issues, should be ready to be tested