init code refacturing