Some cleanup in code