minor changes in code structure