Kadira monitoring and some code cleanup