impl: refactoring, logging and bin