Code refactoring. Lower memory consumption.