simplified more code