move all init code to created