Rename beforeInit as onload and afterInit as init