Cleaned up password formatting code.