Code improvements (renamed beforeInit/init to init/ready