Code cleanup on backend