require and define through one function working