better object constructor