Code Refinements

Made small changes to ensure that the plugin works as efficiently as
possible.