removed some unused branches and functions