Improve init logic