Refactored ESL library from shimaore/esl