wrap init into function