#111 converting initialization to a single function