KFSPTS-3482 Clean code, fix issues