Cleaned up polygon creation with a single function