remove unnecessary begin/end