improve code readability and performance

of waterfall marker rendering