JPMorgan will trim about 19,000 jobs over the next two years but cast a positive spin on the news: It is shrinking the unit it had beefed up to handle troubled mortgages.The bulk of the cuts, about 15,000, will come at the mortgage unit, which had swelled to about 50,000 workers from a pre-financial crisis roster of 20,000 because the bank needed more people to process defaulted mortgages. The bank said it hopes to find jobs in other parts of the company for displaced workers through a "redeployment" program.The rest of the cuts, about 4,000, will come from the consumer banking business, mostly the branches. JPMorgan said those cuts will come through attrition, not lay-offs.The bank noted that it's also adding jobs in certain areas, such as commercial banking and asset management. Overall, it expects its payroll to be down by about 17,000 at the end of 2014. That means it would fall to about 242,000 from its current 259,000, a 6.5 percent reduction.The cuts were revealed in a presentation to investors Tuesday and are part of the bank's bigger cost-cutting campaign. JPMorgan increased its profits and revenue in 2012 and has weathered the financial crisis and its aftermath better than most.But like its peers, it's facing a host of challenges. Banks are navigating new government regulations that have crimped some old sources of revenue, like issuing credit cards to students. The banks have also said that complying with the new regulations is costing them more money.The move could signal a new direction for staffing: JPMorgan already shed about 1,200 jobs in 2012, after adding jobs in 2011 and 2010.Bank of America, Citigroup, Morgan Stanley and Goldman Sachs all trimmed jobs in 2012. Morgan Stanley's current round of job cuts has focused on senior ranks and investment bankers. Bank of America has also said it needs fewer people to work through problem mortgages, though it has cut jobs in other areas. Citigroup is scaling back in countries that it no longer sees as growth engines.Shares of New York-based JPMorgan Chase & Co. ended Tuesday down 10 cents at $47.60. The stock has gained about 24 percent in the past year.