Cleaned up legacy code