improve init code