Possible huge optimization (needs refactoring)