smart initialization