Internal update: classes rearranged and added for functionality