Fixed loose coupling.
fixed sonar issues