(refactor) cleans up work mouseup in railroad directive