Make code consistent and concise between two plugins