clean up wall hit prevention code