Tying the loose ends
Code cleanup