Re-designing: cleaned old code