Added abbreviation functionality and code cleanup.