code cleanup
final code