safety checks and remove todos