[TASK] Code cleanup based on Psalm static analyser