Rearranged the constructor, as well as some methods.