Minor code cleanup
Minor refactoring and cleanup of static methods