Added font utilities and code refactorized