Improve code for creating new items