changed constructor to have less lines