added logging, removed unnecessary steps