Refactor low level implementation