streamlined some codes