improve setStart and setEnd methods