Refactor wall generation for modularity