move a calculation to init instead of call it everytime