refactor the create wall code