* Slight refactroing changes, moving some codes around.