cleaned up dictionary creation