some refactoring & optimization; added texts sorting