Improve code to make it concise