Move if statement into init