functions.inc refaktor