Utility functions uncoupling

Hard coupled utility functions with our internal structures, might cause
troubles some day...
Show warning when debug mode is enabled