more refactor, added random constructor;