stable version

some code cleanup