make more use of chained structure and removed unnecessary variables