removing imperative code