Streamline boundary-markers.js code