refactored the use of side to semantic checking