changed source code structure