refactoring header, added code for definitions