Code cleaned up