revised internal methods and invocations; increased readability of the code here