Rearranged code for ease of access