refactors code samples