Add AstractSpaceBeforeRule and move common logic into it