Refactor and ready to use from external project