Consolidating the code